3. Configuring Multi-Server Query Options
Multi-server query results
have three configurable options. Adding the server name to the results
is one of them, and you've seen that option already in Figure 6. The complete list of options is as follows:
Add login name to the results
Add server name to the results
Merge results into one result set
The default configuration
is to add the server name and merge the results. To change the
multi-server result options, follow these steps:
Select Options from the Tools Menu in SQL Server Management Studio.
Navigate
to Multiserver Results options using the tree menu in the Options
dialog box. Expand the Query Results node, expand the SQL Server node
and then select Multiserver Results, as shown in Figure 6.
Change the options to the desired configuration and click OK.
If the result set is being
merged, the column headers are derived from the first server that
returns the results. If a result set is returned by a subsequent server
that does not have the same number of columns or the column names do
not match, an error will be returned indicating that the result sets
cannot be merged. Also, if one of the servers is missing an object used
in the query, the result sets cannot be merged and an error is returned.
If you do not merge the
results, each result set will have its own schema and column set,
meaning the number of columns or column names do not have to match. You
will, however, receive an error if one of the objects in the query does
not exist on one of the servers in the group. Since each result set is
individually returned, this is more of an informational message
indicating that the server does not contain the object and does not
stop the query from executing on the remaining servers.